#ifndef _PARAMETER_COMMON_H
#define _PARAMETER_COMMON_H
#include <lib/cassert.h>
#include "parameter.h"

typedef struct common_config {
	uint32_t magic;
	uint32_t version;
	uint32_t size;
	uint8_t rev1[4];
	uint64_t core_bit_map;
}__attribute__((aligned(sizeof(unsigned long)))) common_config_t;

/*
*	结构体变量偏移与参数配置说明中必须相同
*/
#define COMMON_MAGIC_OFFSET					0x0
#define COMMON_CORE_MAP_OFFSET				0x10

#define CM_CASSERT( offset, _member)						\
	 CASSERT(offset ==										\
		 __builtin_offsetof(common_config_t, _member),			\
		 assert_##_member##_mismatch)

CM_CASSERT(COMMON_MAGIC_OFFSET, magic);
CM_CASSERT(COMMON_CORE_MAP_OFFSET, core_bit_map);

#define COMMON_CORE_BIT_INFO	(																\
									((CONFIG_C0_0_EN << 0 | CONFIG_C0_1_EN << 1) << 0x0) |		\
									((CONFIG_C1_0_EN << 0 | CONFIG_C1_1_EN << 1) << 0x4) |		\
									((CONFIG_C2_0_EN << 0 | CONFIG_C2_1_EN << 1) << 0x8) |		\
									((CONFIG_C3_0_EN << 0 | CONFIG_C3_1_EN << 1) << 0xc) 		\
								)

#endif

